* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #007bff;
}

header h1 {
    color: #007bff;
    font-size: 2.5em;
    margin-bottom: 10px;
}

main {
    min-height: calc(100vh - 200px);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

.actions {
    margin-bottom: 20px;
    text-align: right;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: bold;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 30px;
}

.student-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.student-table th,
.student-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.student-table th {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

.student-table tr:hover {
    background-color: #f8f9fa;
}

.actions-cell {
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 50px;
    color: #6c757d;
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 20px;
}

.form-container {
    max-width: 600px;
    margin: 0 auto;
}

.student-form {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.required {
    color: #dc3545;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

.form-group input.error,
.form-group select.error {
    border-color: #dc3545;
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.3);
}

.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    display: block;
}

.form-actions {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    border-top: 1px solid #ddd;
    color: #6c757d;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    header h1 {
        font-size: 2em;
    }
    .student-table {
        font-size: 14px;
    }
    .student-table th,
    .student-table td {
        padding: 8px;
    }
    .form-container {
        max-width: 100%;
    }
    .student-form {
        padding: 20px;
    }
    .actions {
        text-align: center;
    }
    .btn {
        display: block;
        margin: 10px 0;
        text-align: center;
    }
    .form-actions .btn {
        display: inline-block;
        margin: 5px;
    }
}

@media (max-width: 480px) {
    .actions-cell {
        white-space: normal;
    }
    .actions-cell .btn {
        display: block;
        margin: 2px 0;
    }
}


/* 新增功能样式 */


/* 搜索和筛选区域 */

.search-filter-container {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-form .search-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input,
.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

.filter-select {
    min-width: 120px;
}

.search-btn {
    padding: 8px 16px !important;
    margin: 0 !important;
}


/* 操作区域 */

.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.actions-left,
.actions-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.total-info {
    color: #6c757d;
    font-weight: 500;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}


/* 成绩颜色标识 */

.score-cell.excellent {
    color: #28a745;
    font-weight: bold;
}

.score-cell.good {
    color: #007bff;
    font-weight: bold;
}

.score-cell.pass {
    color: #ffc107;
    font-weight: bold;
}

.score-cell.fail {
    color: #dc3545;
    font-weight: bold;
}


/* 分页样式 */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding: 20px 0;
}

.page-info {
    font-weight: 500;
    color: #495057;
}


/* 统计页面样式 */

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2.5em;
    opacity: 0.8;
}

.stat-info h3 {
    margin: 0;
    font-size: 2em;
    font-weight: bold;
}

.stat-info p {
    margin: 5px 0 0 0;
    opacity: 0.9;
}


/* 图表容器 */

.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.chart-section {
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.chart-section.full-width {
    grid-column: 1 / -1;
}

.chart-section h3 {
    margin-bottom: 20px;
    color: #495057;
    text-align: center;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.chart-wrapper {
    position: relative;
    height: 300px;
}


/* 详细统计表 */

.detailed-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.stats-section {
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stats-section h3 {
    margin-bottom: 20px;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th,
.stats-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.stats-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.stats-table tr.excellent td:first-child {
    color: #28a745;
    font-weight: bold;
}

.stats-table tr.good td:first-child {
    color: #007bff;
    font-weight: bold;
}

.stats-table tr.average td:first-child {
    color: #6f42c1;
    font-weight: bold;
}

.stats-table tr.pass td:first-child {
    color: #ffc107;
    font-weight: bold;
}

.stats-table tr.fail td:first-child {
    color: #dc3545;
    font-weight: bold;
}


/* 响应式设计优化 */

@media (max-width: 1024px) {
    .charts-container {
        grid-template-columns: 1fr;
    }
    .detailed-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .search-form .search-row {
        flex-direction: column;
        align-items: stretch;
    }
    .search-input,
    .filter-select {
        width: 100%;
    }
    .actions {
        flex-direction: column;
        align-items: stretch;
    }
    .actions-left,
    .actions-right {
        justify-content: center;
    }
    .stats-cards {
        grid-template-columns: 1fr;
    }
    .pagination {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    .chart-wrapper {
        height: 250px;
    }
}


/* 导入页面样式 */

.import-container {
    max-width: 1000px;
    margin: 0 auto;
}

.import-instructions {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    border-left: 4px solid #007bff;
}

.import-instructions h3 {
    color: #495057;
    margin-bottom: 20px;
}

.instruction-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.step-number {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content h4 {
    margin-bottom: 8px;
    color: #495057;
}

.step-content p {
    margin-bottom: 10px;
    color: #6c757d;
}

.step-content ul {
    margin-left: 20px;
    color: #6c757d;
}

.step-content li {
    margin-bottom: 5px;
}


/* 上传区域 */

.upload-section {
    background-color: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.upload-section h3 {
    color: #495057;
    margin-bottom: 20px;
}

.upload-area {
    border: 2px dashed #d1ecf1;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-area:hover {
    border-color: #007bff;
    background-color: #e3f2fd;
}

.upload-area.dragover {
    border-color: #007bff;
    background-color: #e3f2fd;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3em;
    color: #6c757d;
}

.upload-text {
    color: #495057;
}

.upload-main {
    font-size: 16px;
    margin-bottom: 5px;
}

.upload-link {
    color: #007bff;
    text-decoration: underline;
    cursor: pointer;
}

.upload-hint {
    font-size: 14px;
    color: #6c757d;
}


/* 文件信息 */

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background-color: #e8f5e8;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    margin-bottom: 20px;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-icon {
    font-size: 1.5em;
}

.file-name {
    font-weight: 500;
    color: #155724;
}

.file-size {
    color: #6c757d;
    font-size: 14px;
}

.remove-file {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.remove-file:hover {
    background-color: rgba(0, 0, 0, 0.1);
}


/* 导入提示 */

.import-tips {
    background-color: #fff3cd;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #ffc107;
}

.import-tips h3 {
    color: #856404;
    margin-bottom: 15px;
}

.import-tips ul {
    margin-left: 20px;
    color: #856404;
}

.import-tips li {
    margin-bottom: 8px;
}


/* 更新主页面导入导出按钮样式 */

.actions-left .btn {
    margin-right: 10px;
}

.btn-export {
    background-color: #28a745;
    color: white;
}

.btn-export:hover {
    background-color: #218838;
}

.btn-import {
    background-color: #fd7e14;
    color: white;
}

.btn-import:hover {
    background-color: #e36209;
}


/* 响应式设计 */

@media (max-width: 768px) {
    .instruction-content {
        gap: 15px;
    }
    .step {
        flex-direction: column;
        text-align: center;
    }
    .upload-area {
        padding: 30px 20px;
    }
    .upload-icon {
        font-size: 2.5em;
    }
    .file-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .step-content ul {
        margin-left: 10px;
    }
    .upload-area {
        padding: 20px 15px;
    }
}